package visual;

import java.awt.GridBagLayout;
import javax.swing.JPanel;
import java.awt.Dimension;
import javax.swing.JScrollPane;
import java.awt.Rectangle;
import java.util.Iterator;
import java.util.Vector;

import javax.swing.JTable;


import basicas.PessoaFisica;

import fachada.Fachada;

import modelo.ModeloPessoaFisicaADM;

public class ListarPessoaFisicaADM extends JPanel {

	private static final long serialVersionUID = 1L;
	private ModeloPessoaFisicaADM modeloadm = new ModeloPessoaFisicaADM();  //  @jve:decl-index=0:visual-constraint="927,20"
	private JScrollPane jScrollPane = null;
	private JTable jTable = null;

	/**
	 * This is the default constructor
	 */
	public ListarPessoaFisicaADM() {
		super();
		initialize();
	}

	/**
	 * This method initializes this
	 * 
	 * @return void
	 */
	private void initialize() {
		this.setSize(829, 275);
		this.setLayout(null);
		this.add(getJScrollPane(), null);
		
		
		Vector listar = null;
		
		try {
			Fachada F = new Fachada();
			listar = F.listarPessoaFisicaADM();
			} catch (Exception e1) {
				
		}
			modeloadm.removeAll();
			Iterator it = listar.iterator();
			
			while(it.hasNext()){
				PessoaFisica procura = (PessoaFisica) it.next();
				modeloadm.adicionar(procura);
			}
		
	}

	/**
	 * This method initializes jScrollPane	
	 * 	
	 * @return javax.swing.JScrollPane	
	 */
	private JScrollPane getJScrollPane() {
		if (jScrollPane == null) {
			jScrollPane = new JScrollPane();
			jScrollPane.setBounds(new Rectangle(8, 71, 805, 163));
			jScrollPane.setViewportView(getJTable());
		}
		return jScrollPane;
	}

	/**
	 * This method initializes jTable	
	 * 	
	 * @return javax.swing.JTable	
	 */
	private JTable getJTable() {
		if (jTable == null) {
			jTable = new JTable(modeloadm);
		}
		return jTable;
	}

}  //  @jve:decl-index=0:visual-constraint="25,-7"
